package com.example.design.pattern.behavior.observer;

public class ObserverPatternDemo {

    public static void main(String[] args) {
        EventPublisher eventPublisher = new EventPublisher();
        
        EventListener eventListener = new EventListener();
        eventPublisher.addObserver(eventListener);
        
        eventPublisher.publishEvent("发布事件");
        
        eventPublisher.deleteObserver(eventListener);
    }
}
